<template>
  <div>
    <Result v-if="success" type="success" isSuccess="success" title="提交成功"
      description="我们将在1-2个工作日内完成审核，您可以通过“合作机构审核查询”查询进度。" class="result"></Result>
    <div v-if="success" style="text-align:center;">
      <a-button type="primary" @click='closePage'>关闭页面</a-button>

    </div>

    <Result v-if="!success" title="提交失败" class="result" description="" reason='未知错误'></Result>
    <div v-if="!success" style="text-align:center;">
      <!-- <a-button @click="onPrev(10)">上一步</a-button> -->
      <a-button type="primary" @click="Rewrite">重新填写</a-button>
    </div>
  </div>
</template>
<script>
  import Result from "@/components/result/Result";
  import { message } from "ant-design-vue";
  import api from "@/common/api";
  import { error } from "util";
  import { fail } from "assert";
  export default {
    data() {
      return {
        memberNo: "",
        success: true,
        isadmin: false,
      };
    },
    components: {
      Result
    },
    created() {

    },
    mounted() {
      sessionStorage.removeItem("isPrivate")
      this.memberNo = this.$route.query.memberNo;
      
      if(this.$route.query.isadmin){
        this.isadmin = this.$route.query.isadmin;
      }
      console.log(this.$route.query.success);
      if (this.$route.query.success) {
        this.success = true;
      } else {
        this.success = false;
      }
    },
    methods: {
      onPrev(step) {
        var st = step - 1;
        this.$router.push("/OrgRegister/step" + st);
      },
      doNext(step) {
        var st = step + 1;
        this.$router.push("/OrgRegister/step" + st);
      },
      Rewrite() {
        this.$router.push({ path: "/Partners/typeChoose" });
      },
      closePage() {
        if(this.isadmin == true){
          this.$router.push('/Partners/PartnersAdminAuditQuery')
        }else{
          this.$router.push('/Partners/PartnersAuditQuery')
        }
        
        // window.opener = null;
        // window.open("about:blank", "_top").close()
      },
      CloseWebPage() {
        if (navigator.userAgent.indexOf("MSIE") > 0) {
          if (navigator.userAgent.indexOf("MSIE 6.0") > 0) {
            window.opener = null; window.close();
          }
          else {
            window.open('', '_top'); window.top.close();
          }
        }
        else if (navigator.userAgent.indexOf("Firefox") > 0) {
          window.location.href = 'about:blank '; //火狐默认状态非window.open的页面window.close是无效的    
          //window.history.go(-2);     
        }
        else {
          window.opener = null;
          window.open('', '_self', '');
          window.close();
        }
      }
    }
  };
</script>